﻿<%@ Page Title="Frontdesk - AutoResponder Editor" Language="C#" MasterPageFile="~/Views/Shared/Frontdesk.Master"
    Inherits="System.Web.Mvc.ViewPage<Sendz.Domain.User>" %>

<asp:Content ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        User Editor</h2>
    <% using (Ajax.BeginForm(new AjaxOptions { Url = "/Admin/EditUser", OnBegin = "onBegin", UpdateTargetId = "wrapper", InsertionMode = InsertionMode.Replace }))
       { %>
    <% Html.ValidationSummary(true, "Sorry, an error occurred saving this user, please contact the system administrator"); %>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.Username)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.Username)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.Username, new { @class = "frontdesk" })%>
        </div>
    </div>
    <% if ((bool)ViewData["NewUser"])
       { %>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.Password)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.Password)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.Password, new { @class = "frontdesk" })%>
        </div>
    </div>
    <% } %>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.Firstname)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.Firstname)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.Firstname, new { @class = "frontdesk" })%>
        </div>
    </div>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.Lastname)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.Lastname)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.Lastname, new { @class = "frontdesk" })%>
        </div>
    </div>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.Email)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.Email)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.Email, new { @class = "frontdesk" })%>
        </div>
    </div>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.Zipcode)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.Zipcode)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.Zipcode, new { @class = "frontdesk" })%>
        </div>
    </div>
    <div class="form-field">
        <div class="form-field-input">
            <%: Html.CheckBoxFor(u => u.IsAdmin, new { @class = "frontdesk-spaced" })%>&nbsp;<%: Html.LabelFor(u => u.IsAdmin) %>
        </div>
    </div>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.ResponsesRemaining)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.ResponsesRemaining)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.ResponsesRemaining, new { @class = "frontdesk" })%>
        </div>
    </div>
    <div class="form-field">
        <div class="form-field-label">
            <%: Html.LabelFor(u => u.InvitesRemaining)%>
        </div>
        <div class="form-field-error">
            <%: Html.ValidationMessageFor(u => u.InvitesRemaining)%>
        </div>
        <div class="form-field-input">
            <%: Html.TextBoxFor(u => u.InvitesRemaining, new { @class = "frontdesk" })%>
        </div>
    </div>
    <div class="buttons">
        <%: Html.Hidden("UserKey", Model.UserKey) %>
        <%: Html.Hidden("NewUser", ViewData["NewUser"])%>
        <input type="submit" value="Save User" class="button" />
    </div>
    <% if (!(bool)ViewData["NewUser"])
       { %>
    <p class="spaced">
        Created:
        <%: Model.CreatedOn %></p>
    <p class="spaced">
        Last Modified:
        <%: Model.LastModified %></p>
    <p class="spaced">
        Last Login:
        <%: Model.LastLogin %></p>
    <% } %>
    <% } %>
</asp:Content>
<asp:Content ContentPlaceHolderID="Sidebar" runat="server">
    <% Html.RenderPartial("videohelp"); %>
</asp:Content>
<asp:Content ContentPlaceHolderID="footer" runat="server">
</asp:Content>
